package com.zhou.dynamic.service;

import com.zhou.dynamic.mapper.UserInfoMapper;
import com.zhou.dynamic.pojo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.Date;

/**
 * Created by mrzho on 2018/1/24.
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class UserInfoServiceImpl implements UserInfoService{
    @Autowired
    private UserInfoMapper userInfoMapper;

    @Override
    public UserInfo selectByOddUserId(Integer id) {
        return userInfoMapper.selectByOddUserId(id);
    }

    @Override
    public void save() throws Exception {
        UserInfo user1 = new UserInfo(3, "333", 22, "4444", new Date(), "测试");
        userInfoMapper.save(user1);
        // throw new Exception("测试");
    }
}
